package com.strawberry.chat2;

import android.os.Bundle;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.strawberry.chat2.library.splash.SplashScreen;
import com.umeng.message.PushAgent;

public class MainActivity extends ReactActivity {

    //重写这个方法，返回自定义的delegate.
    @Override
    protected ReactActivityDelegate createReactActivityDelegate() {
        MyReactDelegate.context = this;
        return new MyReactDelegate(this,getMainComponentName());
    }

    /**
     * 设置启动页
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this, R.style.SplashScreenTheme);
        super.onCreate(savedInstanceState);
        PushAgent.getInstance(this).onAppStart();
    }

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "barry_chat2";
    }
}
